/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version 2.0;
    format ascii;
    class dictionary;
    location system;
    object snappyHexMeshDict;
}

    castellatedMesh true;
    snap true;
    addLayers true;
    geometry
    {
        flap_lower.stl
        {
            type triSurfaceMesh;
            name flap_lower;
        }
        flap_te.stl
        {
            type triSurfaceMesh;
            name flap_te;
        }
        flap_upper.stl
        {
            type triSurfaceMesh;
            name flap_upper;
        }
        main_lower1.stl
        {
            type triSurfaceMesh;
            name main_lower1;
        }
        main_lower2.stl
        {
            type triSurfaceMesh;
            name main_lower2;
        }
        main_lower3.stl
        {
            type triSurfaceMesh;
            name main_lower3;
        }
        main_upper.stl
        {
            type triSurfaceMesh;
            name main_upper;
        }
        slat_lower.stl
        {
            type triSurfaceMesh;
            name slat_lower;
        }
        slat_upper.stl
        {
            type triSurfaceMesh;
            name slat_upper;
        }
    }

    castellatedMeshControls
    {
        features
        (
        {
            file "flap_lower.eMesh";
            level 8;
        }
        {
            file "flap_te.eMesh";
            level 8;
        }
        {
            file "flap_upper.eMesh";
            level 8;
        }
        {
            file "main_lower1.eMesh";
            level 8;
        }
        {
            file "main_lower2.eMesh";
            level 8;
        }
        {
            file "main_lower3.eMesh";
            level 8;
        }
        {
            file "main_upper.eMesh";
            level 8;
        }
        {
            file "slat_lower.eMesh";
            level 8;
        }
        {
            file "slat_upper.eMesh";
            level 8;
        }

        );
        refinementSurfaces
        {
            flap_lower
            {
                level ( 7 7 );
            }

            flap_te
            {
                level ( 7 7 );
            }
            
            flap_upper
            {
                level ( 7 7 );
            }
            
            main_lower1
            {
                level ( 7 7 );
            }

            main_lower2
            {
                level ( 7 7 );
            }

            main_lower3
            {
                level ( 7 7 );
            }

            main_upper
            {
                level ( 7 7 );
            }

            slat_lower
            {
                level ( 7 7 );
            }

            slat_upper
            {
                level ( 7 7 );
            }
             
        }

        refinementRegions
        {
            
        }

        locationInMesh ( 5 0.5 0.05 );
        maxLocalCells 10000000;
        maxGlobalCells 200000000;
        minRefinementCells 0;
        nCellsBetweenLevels 3;
        resolveFeatureAngle 10;
        allowFreeStandingZoneFaces true;
        planarAngle 30;
        maxLoadUnbalance 0.10;
    }

    snapControls
    {
        nSolveIter 50;
        nSmoothPatch 3;
        tolerance 2.0;
        nRelaxIter 5;
        nFeatureSnapIter 10;
        implicitFeatureSnap false;
        explicitFeatureSnap true;
        multiRegionFeatureSnap false;
    }

    addLayersControls
    {
        layers
        {
            "(main.*|flap.*|slat.*)"
            {nSurfaceLayers 2;}
        }

        relativeSizes true;
        expansionRatio 1.3;
        finalLayerThickness 0.5;
        minThickness 0.001;
        nGrow 0;
        featureAngle 180;
        slipFeatureAngle 80;
        nRelaxIter 5;
        nSmoothSurfaceNormals 1;
        nSmoothNormals 3;
        nSmoothThickness 10;
        maxFaceThicknessRatio 0.5;
        maxThicknessToMedialRatio 0.3;
        minMedialAxisAngle 90;
        nBufferCellsNoExtrude 0;
        nLayerIter 50;
        nRelaxedIter 20;
        writeVTK false;
        noErrors false;
        layerRecovery 1;
        growZoneLayers false;
        projectGrownUp 0.0;
    }

    meshQualityControls
    {
        maxNonOrtho 60;
        maxBoundarySkewness 4;
        maxInternalSkewness 4;
        maxConcave 80;
        minFlatness 0.5;
        minVol 1.00E-13;
        minTetQuality -1e30;
        minArea -1;
        minTwist 0.03;
        minDeterminant 0.01;
        minFaceWeight 0.03;
        minVolRatio 0.01;
        minTriangleTwist -1;
        nSmoothScale 4;
        errorReduction 0.75;
        relaxed {maxNonOrtho 65; maxBoundarySkewness 5; minTetQuality -1e30; }

    }

    debug 0;
    mergeTolerance 1E-6;
    autoBlockMesh false;
